package cen.tms.ggtour;

import cen.tms.ggtour.data.DataManager;
import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.widget.TextView;

public class DisplayEvent extends Activity{
	//Jonathan Vars
	Cursor thisEvent;
	//end Jonathan Vars

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//Jonathan Code
		//fill UI
		setContentView(R.layout.displayevent);
		TextView txtName = (TextView)findViewById(R.id.eventName);
        TextView txtDate = (TextView)findViewById(R.id.eventDate);
        TextView txtTime = (TextView)findViewById(R.id.eventTime);
        TextView txtLocation = (TextView)findViewById(R.id.eventLocation);
        TextView txtDescription = (TextView)findViewById(R.id.eventDescription);
        //get event to display using _id in bundle
        Cursor thisEvent = DataManager.getInstance(this).getEvent(getIntent().getExtras().getInt("_id"));
        startManagingCursor(thisEvent);
        //Place info on UI
        txtName.setText(DataManager.getName(thisEvent));
        txtDate.setText(DataManager.getDate(thisEvent));
        txtTime.setText(DataManager.getTime(thisEvent));
        txtLocation.setText(DataManager.getLocation(thisEvent));
        txtDescription.setText(DataManager.getDescription(thisEvent));
        //end Jonathan Code
	}
}
